Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruff: Add PLR02 and fix PLR0202 #11712

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

kiblik
Copy link
Contributor

@kiblik kiblik commented Feb 2, 2025

Merge PLR02* rules and fix no-classmethod-decorator (PLR0202)

Copy link

dryrunsecurity bot commented Feb 2, 2025

DryRun Security Summary

The pull request focuses on enhancing code quality and security through modifications to the ruff.toml configuration file and minor refactoring of the MonthYearWidget class in forms.py, primarily adjusting linting rules and improving method implementation while maintaining security standards.

Expand for full summary

Summary:

The changes in this pull request appear to be focused on improving the overall code quality and security of the project. The key changes include:

  1. Modifications to the ruff.toml configuration file, which is used to configure the Ruff linter for the Python project. The changes involve removing certain linting rules, while including various security-related rules to catch common security issues. Additionally, the configuration excludes the dojo/db_migrations directory from the linting process and increases the McCabe complexity limit.

  2. A minor refactoring of the id_for_label() method in the MonthYearWidget class within the dojo/forms.py file. This change does not introduce any significant security implications.

While the changes do not appear to introduce any immediate security vulnerabilities, it's essential to review the specific rules that were removed or modified in the ruff.toml file to ensure that the changes do not compromise the overall security of the application. Additionally, it's important to review the entire codebase, especially the forms handling user input, to ensure that all user input is properly validated and sanitized to prevent common web application vulnerabilities.

Files Changed:

  1. ruff.toml: The changes in this file involve removing the PLR0203 and PLR0206 linting rules, while including various security-related rules. The configuration also excludes the dojo/db_migrations directory from the linting process and increases the McCabe complexity limit.

  2. dojo/forms.py: The changes in this file involve a minor refactoring of the id_for_label() method in the MonthYearWidget class, converting it from a regular method to a class method using the @classmethod decorator.

Code Analysis

We ran 9 analyzers against 2 files and 0 analyzers had findings. 9 analyzers had no findings.

View PR in the DryRun Dashboard.

Copy link
Contributor

github-actions bot commented Feb 6, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link
Contributor

github-actions bot commented Feb 6, 2025

Conflicts have been resolved. A maintainer will review the pull request shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants